package com.tbit.main.pojo;

import lombok.Data;

/**
 * @author LMY
 * @create 2020-11-16 10:36
 * 资产预警开关
 */
@Data
public class MachineAlarm {
    /**
     * 运营区域id
     */
    private Integer accountId;
    /**
     * 预警号码
     */
    private String alarmPhone;
    /**
     * 超区告警开关
     */
    private Integer geoAlarmSwitch;
    /**
     * 闲置告警开关
     */
    private Integer idleAlarmSwitch;
    /**
     * 闲置时间
     */
    private Integer idleAlarmTime;
    /**
     * 断电告警开关
     */
    private Integer powerAlarmSwitch;
    /**
     * 无信号告警开关
     */
    private Integer offlineAlarmSwitch;
    /**
     * 无信号时间
     */
    private Integer offlineAlarmTime;
    /**
     * 无定位告警开关
     */
    private Integer locationAlarmSwitch;
    /**
     * 无定位时间
     */
    private Integer locationAlarmTime;
    /**
     * 非法移动告警开关
     */
    private Integer illegalityMoveSwitch;
    /**
     * 丢失车辆开关
     */
    private Integer machineLoseSwitch;
    /**
     * 备注
     */
    private String remark;
    /**
     * 运营区域id
     */
    private String name;
    /**
     * 未关电池锁告警开关
     */
    private Integer batterLockSwitch;
    /**
     * 倾倒，侧翻告警开关
     */
    private Integer rolloverSwitch;
    /**
     * 摄像头故障告警开关
     */
    private Integer cameraSwitch;
    /**
     * 摄像头遮挡告警开关
     */
    private Integer cameraCoverSwitch;
    /**
     * 高速出界告警开关
     */
    private Integer geoOutBoundsSwitch;
    /**
     * 高速出界告警速度 km/s
     */
    private Integer geoOutSpeed;

    /**
     * 超长订单预警开关
     */
    private Integer longOrderSwitch;

    /**
     * 超长订单预警阈值
     */
    private Integer longOrderTime;

    public void loadDefaultField() {
        if (this.getGeoAlarmSwitch() == null) {
            this.setGeoAlarmSwitch(0);
        }
        if (this.getIdleAlarmSwitch() == null) {
            this.setIdleAlarmSwitch(0);
        }
        if (this.getIdleAlarmTime() == null) {
            this.setIdleAlarmTime(24);
        }
        if (this.getPowerAlarmSwitch() == null) {
            this.setPowerAlarmSwitch(0);
        }
        if (this.getOfflineAlarmSwitch() == null) {
            this.setOfflineAlarmSwitch(0);
        }
        if (this.getOfflineAlarmTime() == null) {
            this.setOfflineAlarmTime(25);
        }
        if (this.getLocationAlarmSwitch() == null) {
            this.setLocationAlarmSwitch(0);
        }
        if (this.getLocationAlarmTime() == null) {
            this.setLocationAlarmTime(6);
        }
        if (this.getIllegalityMoveSwitch() == null) {
            this.setIllegalityMoveSwitch(0);
        }
        if (this.getMachineLoseSwitch() == null) {
            this.setMachineLoseSwitch(0);
        }
        if (this.getRolloverSwitch() == null) {
            this.setRolloverSwitch(0);
        }
        if (this.getCameraCoverSwitch() == null) {
            this.setCameraCoverSwitch(0);
        }
        if (this.getCameraSwitch() == null) {
            this.setCameraSwitch(0);
        }
        if (this.getGeoOutBoundsSwitch() == null) {
            this.setGeoOutBoundsSwitch(0);
        }
        if (this.getGeoOutSpeed() == null) {
            this.setGeoOutSpeed(0);
        }
        if (this.getRemark() == null) {
            this.setRemark("");
        }
        if (this.getBatterLockSwitch() == null) {
            this.setBatterLockSwitch(0);
        }
        if (this.getLongOrderSwitch() == null) {
            this.setLongOrderSwitch(0);
        }
        if (this.getLongOrderTime() == null) {
            this.setLongOrderTime(12);
        }
    }
}
